package com.xfcy.blog.controller.web;

import com.xfcy.blog.annotation.BusinessLogger;
import com.xfcy.blog.common.R;
import com.xfcy.blog.dto.FeedBackDTO;
import com.xfcy.blog.service.FeedBackService;
import com.xfcy.blog.valid.AddGroup;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 晓风残月Lx
 * @date 2023/4/22 18:19
 */
@RestController
@RequestMapping("/web/feedback")
@Api(tags = "门户反馈管理")
public class WebFeedBackController {

    @Autowired
    private FeedBackService feedBackService;

    @BusinessLogger(value = "首页-添加反馈", type = "添加", desc = "添加反馈")
    @PostMapping(value = "/add")
    @ApiOperation(value = "首页-添加反馈", httpMethod = "POST", response = R.class, notes = "添加反馈")
    public R addFeedBack(@Validated(AddGroup.class) @RequestBody FeedBackDTO feedBackDTO) {
        return feedBackService.insertFeedBack(feedBackDTO);
    }

}
